package edu.xmut.decorator;

/**
 * @author 朔风
 * @date 2024-02-27 17:21
 */
public abstract class Decorator extends Component{
    protected Component component;

    /**
     * 装饰一个Component对象
     *
     * @param component
     */
    public void setComponent(Component component) {
        this.component = component;
    }

    @Override
    public void operation() {
        if (component != null) {
            component.operation();
        }
    }
}
